package com.kube.design.singleton;

/**
 * @author q.zhangr
 * @version 1.0.0
 * @date 2020/7/22
 */
public class SingletonLazy {

    public static void main(String[] args) {
        President zt1 = President.getInstance();
        //输出总统的名字
        zt1.getName();
        President zt2 = President.getInstance();
        //输出总统的名字
        zt2.getName();
        if (zt1 == zt2) {
            System.out.println("他们是同一人！");
        } else {
            System.out.println("他们不是同一人！");
        }
    }
}
